package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.TransactionMiddle;
import com.ruoyi.system.domain.TransferRequest;
import com.ruoyi.system.service.ITransactionMiddleService;
import com.ruoyi.system.service.IWalletService;
import com.ruoyi.util.TimestampIdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InAndOutOrderMapper;
import com.ruoyi.system.domain.InAndOutOrder;
import com.ruoyi.system.service.IInAndOutOrderService;

import javax.annotation.Resource;

/**
 * 转入和转出订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-15
 */
@Service
public class InAndOutOrderServiceImpl implements IInAndOutOrderService 
{
    @Resource
    private InAndOutOrderMapper inAndOutOrderMapper;
    @Resource
    private IWalletService walletService;
    @Resource
    private ITransactionMiddleService transactionMiddleService;

    /**
     * 查询转入和转出订单
     *
     * @param id 转入和转出订单主键
     * @return 转入和转出订单
     */
    @Override
    public InAndOutOrder selectInAndOutOrderById(Long id)
    {
        System.out.println("id的类型是"+id.getClass().getName());
        return inAndOutOrderMapper.selectInAndOutOrderById(id);    }

    /**
     * 查询转入和转出订单列表
     * 
     * @param inAndOutOrder 转入和转出订单
     * @return 转入和转出订单
     */
    @Override
    public List<InAndOutOrder> selectInAndOutOrderList(InAndOutOrder inAndOutOrder)
    {
        return inAndOutOrderMapper.selectInAndOutOrderList(inAndOutOrder);
    }

    /**
     * 新增转入和转出订单
     * 
     * @param inAndOutOrder 转入和转出订单
     * @return 结果
     */
    @Override
    public int insertInAndOutOrder(InAndOutOrder inAndOutOrder) throws InterruptedException {
        return inAndOutOrderMapper.insertInAndOutOrder(inAndOutOrder);
    }

    /**
     * 修改转入和转出订单
     * 
     * @param inAndOutOrder 转入和转出订单
     * @return 结果
     */
    @Override
    public int updateInAndOutOrder(InAndOutOrder inAndOutOrder)
    {
        return inAndOutOrderMapper.updateInAndOutOrder(inAndOutOrder);
    }

    /**
     * 批量删除转入和转出订单
     * 
     * @param ids 需要删除的转入和转出订单主键
     * @return 结果
     */
    @Override
    public int deleteInAndOutOrderByIds(String[] ids)
    {
        return inAndOutOrderMapper.deleteInAndOutOrderByIds(ids);
    }

    /**
     * 删除转入和转出订单信息
     * 
     * @param id 转入和转出订单主键
     * @return 结果
     */
    @Override
    public int deleteInAndOutOrderById(Long id)
    {
        return inAndOutOrderMapper.deleteInAndOutOrderById(id);
    }
}
